
//
//  ComeposeLuckyViewModel.m
//  meiyinxiang
//
//  Created by apple on 2017/11/2.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "ComeposeLuckyViewModel.h"
#import "ComposeCateModel.h"
@interface ComeposeLuckyViewModel ()

@end

@implementation ComeposeLuckyViewModel
- (void)setYYModelData:(NSArray *)data{
    if (self.modelArray == nil) {
        self.modelArray = [NSMutableArray array];
    }
    NSError *err = nil;
    //NSMutableArray *cateArray = [NSMutableArray array];
    for (NSDictionary *dic in data) {
       // NSLog(@"%@",dic[@"sectionCategory"]);
       // cateArray = [ComposeCateModel arrayOfModelsFromDictionaries:dic[@"sectionCategory"] error:&err];
        ComposeMoneyModel *model = [[ComposeMoneyModel alloc] initWithDictionary:dic error:&err];
        [self.modelArray addObject:model];
    }
    
}
- (void)getResource{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"ComposeLuckyMoney" ofType:@"json"];
    NSData *data = [NSData dataWithContentsOfFile:path];
    NSError *error = [[NSError alloc] init];
    NSArray *dicArray = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
    [self setYYModelData:dicArray];
}

@end
